package com.atguigu.gulimall.product.entity;


import com.atguigu.common.valid.AddGroupAn;
import com.atguigu.common.valid.ListValue;
import com.atguigu.common.valid.UpdateGroupAn;
import com.atguigu.common.valid.UpdateStatusGroup;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * Ʒ?
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2022-08-21 16:52:15
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	@Null(message = "新增不能指定Id",groups = {AddGroupAn.class})
	@NotNull(message = "修改必须指定品牌id",groups = {UpdateGroupAn.class})
	private Long brandId;
	/**
	 * 品牌name
	 */
	@NotBlank(message = "品牌名不能为空",groups = {AddGroupAn.class,UpdateGroupAn.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotEmpty(groups = {AddGroupAn.class})
	@URL(message = "logo必须是一个合法的url地址",groups = {AddGroupAn.class,UpdateGroupAn.class})
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态״
	 */
	@ListValue(value = {0,1},groups ={AddGroupAn.class, UpdateStatusGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotEmpty(groups = {AddGroupAn.class})
	@Pattern(regexp = "^[a-zA-Z]$",message = "检索首字母必须是一个字母",groups = {AddGroupAn.class,UpdateGroupAn.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull
	@Min(0)
	private Integer sort;

}
